{include file="public/top"}
<article class="page-container">
    <form class="form-horizontal" role="form" action="" method="post" enctype="multipart/form-data" >
    <input type="hidden" name="id" value="{$arts.id}">
    <div class="row cl" style="padding-top:20px;margin-left:-40px;">
        <label for="username" class="form-label col-xs-4 col-sm-3"><span class="c-red">*</span>所属栏目：</label>
        <div class="formControls col-xs-8 col-sm-9"> 
            <span class="select-box" style="width:150px;">
                <select name="cateid" class="select" size="1" >
                    {volist name="cateres" id="cate"}
                        <option {if condition="$cate['id'] eq $arts['cateid']"}selected="selected"{/if} value="{$cate.id}">{if condition="$cate['level'] neq 0"}|{/if}<?php echo str_repeat('-', $cate['level']*4)?>{$cate.catename}</option>
                    {/volist}
                </select>
            </span> 
        </div>
    </div>

    <div class="row cl" style="padding-top:20px;margin-left:-40px;">
        <label for="username" class="form-label col-xs-4 col-sm-3">
            <span class="c-red">*</span>文章标题：
        </label>
        <div class="formControls col-xs-8 col-sm-4">
            <input type="text" class="input-text" value="{$arts.title}" placeholder="文章标题" id="title" name="title">
        </div>
    </div>

    <div class="row cl" style="padding-top:20px;margin-left:-40px;">
        <label for="username" class="form-label col-xs-4 col-sm-3" >缩略图：</label>
        <div class="formControls col-xs-8 col-sm-4">
            <input class="input-text" style="float:left;"  placeholder="" name="thumb" type="file">
                {if condition="$arts['thumb'] neq ''"}
                <img style="float:left;" src="{$arts.thumb}" width="30">
                {else /}
                暂无缩略图
                {/if}
        </div>
    </div>

    <div class="row cl" style="padding-top:20px;margin-left:-40px;">
        <label for="group_id" class="form-label col-xs-4 col-sm-3" >作者：</label>
        <div class="formControls col-xs-8 col-sm-4">
            <input type="txt" class="input-text" autocomplete="off" value="{$arts.author}" placeholder="作者" id="author" name="author">
        </div>
    </div>

    <div class="row cl" style="padding-top:20px;margin-left:-40px;">
        <label for="username" class="form-label col-xs-4 col-sm-3" >关键词：</label>
        <div class="formControls col-xs-8 col-sm-4">
            <input type="txt" class="input-text" autocomplete="off" value="{$arts.keywords}" placeholder="关键词" id="keywords" name="keywords">
        </div>
    </div>

    <div class="row cl" style="padding-top:20px;margin-left:-40px;">
        <label for="username" class="form-label col-xs-4 col-sm-3"><span class="c-red">*</span>是否推荐：</label>
        <div class="formControls col-xs-8 col-sm-9 skin-minimal">
            <div class="radio-box">
                <input name="rec" type="radio" id="rec-1" value="1" checked>
                <label for="rec-1">是</label>
            </div>
            <div class="radio-box">
                <input name="rec" type="radio" id="rec-2" value="0">
                <label for="rec-2">否</label>
            </div>
        </div>
    </div>
    <div class="row cl" style="padding-top:20px;margin-left:-40px;">
        <label for="username" class="form-label col-xs-4 col-sm-2">视频上传：</label>
        <div class="formControls col-xs-8 col-sm-9"> 
            <script id="content" name="content" type="text/plain" value="{$arts.content}" ></script> 
        </div>
    </div>

    <div class="row cl" style="padding-top:20px;margin-left:40px;">
        <div class="col-xs-8 col-sm-9 col-xs-offset-4 col-sm-offset-3">
            <input class="btn btn-primary radius" type="submit" value="&nbsp;&nbsp;提交&nbsp;&nbsp;">
        </div>
    </div>
    </form>
</article>

<!--请在下方写此页面业务相关的脚本-->
<script type="text/javascript" src="__ADMIN__/lib/jquery.validation/1.14.0/jquery.validate.js"></script> 
<script type="text/javascript" src="__ADMIN__/lib/jquery.validation/1.14.0/validate-methods.js"></script> 
<script type="text/javascript" src="__ADMIN__/lib/jquery.validation/1.14.0/messages_zh.js"></script>

<script type="text/javascript" src="__ADMIN__/lib/ueditor/1.4.3/ueditor.config.js"></script> 
<script type="text/javascript" src="__ADMIN__/lib/ueditor/1.4.3/ueditor.all.min.js"> </script> 
<script type="text/javascript" src="__ADMIN__/lib/ueditor/1.4.3/lang/zh-cn/zh-cn.js"></script>
<script type="text/javascript">
$(function(){
    $('.skin-minimal input').iCheck({
        checkboxClass: 'icheckbox-blue',
        radioClass: 'iradio-blue',
        increaseArea: '20%'
    });
    
    $("#form-admin-add").validate({
        rules:{
            adminName:{
                required:true,
                minlength:4,
                maxlength:16
            },
            password:{
                required:true,
            },
            password2:{
                required:true,
                equalTo: "#password"
            },
            sex:{
                required:true,
            },
            phone:{
                required:true,
                isPhone:true,
            },
            email:{
                required:true,
                email:true,
            },
            adminRole:{
                required:true,
            },
        },
        onkeyup:false,
        focusCleanup:true,
        success:"valid",
        submitHandler:function(form){
            $(form).ajaxSubmit({
                type: 'post',
                url: "xxxxxxx" ,
                success: function(data){
                    layer.msg('添加成功!',{icon:1,time:1000});
                },
                error: function(XmlHttpRequest, textStatus, errorThrown){
                    layer.msg('error!',{icon:1,time:1000});
                }
            });
            var index = parent.layer.getFrameIndex(window.name);
            parent.$('.btn-refresh').click();
            parent.layer.close(index);
        }
    });
});
</script> 
<script type="text/javascript">

    //实例化编辑器
    //建议使用工厂方法getEditor创建和引用编辑器实例，如果在某个闭包下引用该编辑器，直接调用UE.getEditor('editor')就能拿到相关的实例
    UE.getEditor('content',{initialFrameWidth:600,initialFrameHeight:400,});
</script>
<!--/请在上方写此页面业务相关的脚本-->
{include file="public/footer"}